/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BookManager;

/**
 *
 * @author mif
 */
public class Globals {
    static long Actions;
    static long Memory;
    static long peakMem;
    
    public static void zeroActions() {
	Actions = 0;
    }
    
    public static void zeroMemory() {
	Memory = 0;
	peakMem = 0;
    }
    
    public static void zeroAll() {
	zeroActions();
	zeroMemory();
    }
    
    public static void incMem() {
	Memory++;
	if(Memory > peakMem)
	    peakMem = Memory;
    }
    public static void addMem(long i) {
	Memory += i;
	if(Memory > peakMem)
	    peakMem = Memory;
    }
    public static void decMem() {
	Memory--;
    }
    public static void setMem(long i) {
	Memory = i;
	if(Memory > peakMem)
	    peakMem = Memory;
    }
    
    public static String getString() {
	return Long.toString(Actions) + " Actions and " + Long.toString(peakMem) + " peak Memory";
    }
    
}
